<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <style>
    html,
    body,
    #container {
      width: 100%;
      height: 100%;
    }
    </style>
    <title>线</title>
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
    <script src="https://webapi.amap.com/maps?v=1.4.14&key=3f3868abdb36336114bde5ab6eecdb68&plugin=AMap.PolyEditor"></script>
    <script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
</head>
<body>
<div id="container"></div>
<script type="text/javascript">
    let map = new AMap.Map("container", {
        center: [115.8254620785249,39.24481158281995],
        zoom: 20
    });

    function createLine(path) {
      let polyline = new AMap.Polyline({
        path: path,
        isOutline: true,
        outlineColor: '#ffeeff',
        borderWeight: 2,
        strokeColor: "#3366FF",
        strokeOpacity: 1,
        strokeWeight: 3,
        strokeStyle: "solid",
        strokeDasharray: [10, 5],
        lineJoin: 'round',
        lineCap: 'round',
        zIndex: 50,
      })
      polyline.setMap(map)
    }


    let lineArr = [
      [{
        "x": 39.24481158281995,
        "y": 115.8254620785249,
        "z": 0.0
      }, {
        "x": 39.26407977670133,
        "y": 115.8402989729992,
        "z": 0.0
      }],
      [{
        "x": 39.24478369851605,
        "y": 115.8255220473351,
        "z": 0.0
      }, {
        "x": 39.26405222709794,
        "y": 115.8403589355059,
        "z": 0.0
      }],
      [{
        "x": 39.24475622400647,
        "y": 115.8255806771779,
        "z": 0.0
      },{
        "x": 39.26402446872132,
        "y": 115.8404187391947,
        "z": 0.0
      }],
      [{
        "x": 39.24472824374561,
        "y": 115.8256400683271,
        "z": 0.0
      },{
        "x": 39.26399647513949,
        "y": 115.8404775386841,
        "z": 0.0
      }],
      [{
        "x": 39.24470072483505,
        "y": 115.8256996602352,
        "z": 0.0
      },{
        "x": 39.26396869486684,
        "y": 115.8405387677818,
        "z": 0.0
      }],
      [{
        "x": 39.24467300028525,
        "y": 115.8257594061093,
        "z": 0.0
      },{
        "x": 39.26394080789611,
        "y": 115.8405983301304,
        "z": 0.0
      }],
      [{
        "x": 39.24464497453881,
        "y": 115.8258196550421,
        "z": 0.0
      }, {
        "x": 39.2639134832806,
        "y": 115.8406573849462,
        "z": 0.0
      }],
      [{
        "x": 39.24461684232934,
        "y": 115.8258800678687,
        "z": 0.0
      }, {
        "x": 39.26388511397821,
        "y": 115.8407182644232,
        "z": 0.0
      }]
    ]

    for(let i = 0;i<lineArr.length;i++){
      let line = [];

      for(let j = 0;j<lineArr[i].length;j++){
        line.push([lineArr[i][j].y,lineArr[i][j].x])
      }
      createLine(line)
    }

</script>
</body>
</html>
